/**
 * 
 */
package com.bot.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * @author zhaoyan
 *
 * 2020年2月3日
 */
public class Applicant implements Serializable{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5351603204462819264L;
	private Integer id;
	@NotBlank(message = "姓名不能为空")
	private String name;
	
	@NotNull(message = "性别不能为空")
	private Gender gender;
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@Past(message = "生日必须小于当前日期")
	private Date  birthday;
	
	@NotBlank(message = "大学不能为空")
	@Length(max = 80,min=2,message = "大学名称长度在2-80之间")
	private String college;
	@NotBlank(message = "专业不能为空")
	@Length(max = 80,min=2,message = "专业名称长度在2-80之间")
	private String major;
	@NotNull(message = "学历不能为空")
	private Integer edu;
	@NotNull(message = "学位不能为空")
	private Integer degree;
	private Date created;
	//	扩展字段
	private String strScore;
	
	private String avgScore;
	
	public String getStrScore() {
		return strScore;
	}
	public void setStrScore(String strScore) {
		this.strScore = strScore;
	}
	public String getAvgScore() {
		return avgScore;
	}
	public void setAvgScore(String avgScore) {
		this.avgScore = avgScore;
	}
	@Override
	public String toString() {
		return "Applicant [id=" + id + ", name=" + name + ", gender=" + gender + ", birthday=" + birthday + ", college="
				+ college + ", major=" + major + ", edu=" + edu + ", degree=" + degree + ", created=" + created + "]";
	}
	/**
	 * @param id
	 * @param name
	 * @param gender
	 * @param birthday
	 * @param college
	 * @param major
	 * @param edu
	 * @param degree
	 * @param created
	 */
	public Applicant(Integer id, String name, Gender gender, @Pattern(regexp = "yyyy-MM-dd") Date birthday,
			String college, String major, Integer edu, Integer degree, Date created) {
		super();
		this.id = id;
		this.name = name;
		this.gender = gender;
		this.birthday = birthday;
		this.college = college;
		this.major = major;
		this.edu = edu;
		this.degree = degree;
		this.created = created;
	}
	/**
	 * 
	 */
	public Applicant() {
		super();
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Gender getGender() {
		return gender;
	}
	public void setGender(Gender gender) {
		this.gender = gender;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public String getCollege() {
		return college;
	}
	public void setCollege(String college) {
		this.college = college;
	}
	public String getMajor() {
		return major;
	}
	public void setMajor(String major) {
		this.major = major;
	}
	public Integer getEdu() {
		return edu;
	}
	public void setEdu(Integer edu) {
		this.edu = edu;
	}
	public Integer getDegree() {
		return degree;
	}
	public void setDegree(Integer degree) {
		this.degree = degree;
	}
	public Date getCreated() {
		return created;
	}
	public void setCreated(Date created) {
		this.created = created;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((birthday == null) ? 0 : birthday.hashCode());
		result = prime * result + ((college == null) ? 0 : college.hashCode());
		result = prime * result + ((created == null) ? 0 : created.hashCode());
		result = prime * result + ((degree == null) ? 0 : degree.hashCode());
		result = prime * result + ((edu == null) ? 0 : edu.hashCode());
		result = prime * result + ((gender == null) ? 0 : gender.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((major == null) ? 0 : major.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Applicant other = (Applicant) obj;
		if (birthday == null) {
			if (other.birthday != null)
				return false;
		} else if (!birthday.equals(other.birthday))
			return false;
		if (college == null) {
			if (other.college != null)
				return false;
		} else if (!college.equals(other.college))
			return false;
		if (created == null) {
			if (other.created != null)
				return false;
		} else if (!created.equals(other.created))
			return false;
		if (degree == null) {
			if (other.degree != null)
				return false;
		} else if (!degree.equals(other.degree))
			return false;
		if (edu == null) {
			if (other.edu != null)
				return false;
		} else if (!edu.equals(other.edu))
			return false;
		if (gender != other.gender)
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (major == null) {
			if (other.major != null)
				return false;
		} else if (!major.equals(other.major))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
	
	
	
	

}
